package com.memory.service.controller;

import com.memory.service.mapper.PostMapper;
import com.memory.common.model.entity.Post;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 邓哈哈
 * 2023/7/28 22:52
 * Function: 随机生成一条诗词
 * Version 1.0
 */

@RestController
@RequestMapping("/post")
public class PostController {
    @Resource
    private PostMapper postMapper;

    @PostMapping("/one/post")
    public Post getRandomWord() {

        return postMapper.getRandomPost();
    }
}
